/****************************************************/
// Theme name: Nexus - Bootstrap Admin Template
// Theme URI: http://nexus.lethemes.net/1.0/html/
// Description: Nexus is a fully responsive admin dashboard template
// Tags: admin, admin dashboard, cms, crm, project managerment, responsive, webapp, backend, bootstrap admin, responsive admin
// Author: Loi Le
// Version: 1.0
/****************************************************/

// Line chart data
// --------------------------------------------------
var lineChartData = {
    labels: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul"],
    datasets: [{
        label: "My First dataset",
        fillColor: "#5A46CB",
        strokeColor: "#5A46CB",
        pointColor: "#5A46CB",
        pointStrokeColor: "#5A46CB",
        pointHighlightFill: "#5A46CB",
        pointHighlightStroke: "#5A46CB",
        data: [65, 59, 80, 81, 56, 55, 40]
    }, {
        label: "My Second dataset",
        fillColor: "#46BFCB",
        strokeColor: "#46BFCB",
        pointColor: "#46BFCB",
        pointStrokeColor: "#46BFCB",
        pointHighlightFill: "#46BFCB",
        pointHighlightStroke: "#46BFCB",
        data: [28, 48, 40, 19, 86, 27, 90]
    }]
};
// Bar chart data
// --------------------------------------------------
var barChartData = {
    labels: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul"],
    datasets: [{
        label: "My First dataset",
        fillColor: "#46BFCB",
        strokeColor: "#46BFCB",
        highlightFill: "#46BFCB",
        highlightStroke: "#46BFCB",
        data: [65, 59, 80, 81, 56, 55, 40]
    }, {
        label: "My Second dataset",
        fillColor: "#5A46CB",
        strokeColor: "#5A46CB",
        highlightFill: "#5A46CB",
        highlightStroke: "#5A46CB",
        data: [28, 48, 40, 19, 86, 27, 90]
    }]
};
// Rada chart data
// --------------------------------------------------
var radarChartData = {
    labels: ["Eating", "Drinking", "Sleeping", "Designing", "Coding", "Cycling", "Running"],
    datasets: [{
        label: "My First dataset",
        fillColor: "#22A7F0",
        strokeColor: "#22A7F0",
        pointColor: "#22A7F0",
        pointStrokeColor: "#22A7F0",
        pointHighlightFill: "#22A7F0",
        pointHighlightStroke: "#22A7F0",
        data: [65, 59, 90, 81, 56, 55, 40]
    }, {
        label: "My Second dataset",
        fillColor: "#5A46CB",
        strokeColor: "#5A46CB",
        pointColor: "#5A46CB",
        pointStrokeColor: "#5A46CB",
        pointHighlightFill: "#5A46CB",
        pointHighlightStroke: "#5A46CB",
        data: [28, 48, 40, 19, 96, 27, 100]
    }]
};
// Polar chart data
// --------------------------------------------------
var polarChartData = [{
    value: 300,
    color: "#5A46CB",
    highlight: "#5A46CB",
    label: "Success"
}, {
    value: 70,
    color: "#495AD5",
    highlight: "#495AD5",
    label: "Info"
}, {
    value: 100,
    color: "#4B77BE",
    highlight: "#4B77BE",
    label: "Primary"
}, {
    value: 60,
    color: "#49A4D5",
    highlight: "#49A4D5",
    label: "Warning"
}, {
    value: 120,
    color: "#46BFCB",
    highlight: "#46BFCB",
    label: "Default"
}];
// Pie chart data
// --------------------------------------------------
var pieChartData = [{
    value: 300,
    color: "#5A46CB",
    highlight: "#5A46CB",
    label: "Success"
}, {
    value: 50,
    color: "#4B77BE",
    highlight: "#4B77BE",
    label: "Primary"
}, {
    value: 100,
    color: "#46BFCB",
    highlight: "#46BFCB",
    label: "Danger"
}]
window.onload = function() {
    // Global chart configuration
    Chart.defaults.global.responsive = true;
    Chart.defaults.global.maintainAspectRatio = false;
    Chart.defaults.global.scaleFontFamily = "'Source Sans Pro', sans-serif";
    Chart.defaults.global.scaleFontSize = 12;
    Chart.defaults.global.scaleFontColor = "#000";
    Chart.defaults.global.scaleLineColor = "#DDD",
    Chart.defaults.global.tooltipTitleFontFamily = "'Source Sans Pro', sans-serif";
    Chart.defaults.global.tooltipTitleFontSize = 12;
    Chart.defaults.global.tooltipCornerRadius = 2;
    // Line chart
    var ctxLine = document.getElementById("linechart").getContext("2d");
    window.myLine = new Chart(ctxLine).Line(lineChartData, {
        scaleGridLineColor: "#DDD",
        scaleOverride: true,
        scaleSteps: 5,
        scaleStepWidth: 20,
        scaleStartValue: 0,
        scaleLabel: "<%= value %>",
        multiTooltipTemplate: "<%= datasetLabel %>: <%= value %>",
        datasetFill: true,
    });
    // Bar chart
    var ctxBar = document.getElementById("barchart").getContext("2d");
    window.myBar = new Chart(ctxBar).Bar(barChartData, {
        scaleOverride: true,
        scaleSteps: 5,
        scaleStepWidth: 20,
        scaleStartValue: 0,
        scaleLabel: "<%= value %>",
        multiTooltipTemplate: "<%= datasetLabel %>: <%= value %>",
        datasetFill: true,
    });
    // Radar chart
    window.myRadar = new Chart(document.getElementById("radarchart").getContext("2d")).Radar(radarChartData, {
        pointLabelFontSize: 10,
        pointLabelFontFamily: "'Source Sans Pro', sans-serif",
    });
    // Polar chart
    var ctxPolar = document.getElementById("polarchart").getContext("2d");
    window.myPolarArea = new Chart(ctxPolar).PolarArea(polarChartData);
    // Pie chart
    var ctxPie = document.getElementById("piechart").getContext("2d");
    window.myPie = new Chart(ctxPie).Pie(pieChartData);
    // Doughnut chart
    var ctxDoughnut = document.getElementById("doughnutchart").getContext("2d");
    window.myDoughnut = new Chart(ctxDoughnut).Doughnut(pieChartData);
}